<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        body {
            min-height: 100vh;
            background-color: #abefe9;
        }

        body>div {
            display: inline-block;
        }

        hr {
            background-color: red;
            height: 1px;
            border: 0;
        }

        .d1 {
            height: 200px;
            width: 200px;
            background-color: #fcc;
            border: #ccf 3px solid;
            overflow: hidden;
        }

        .d1-1 {
            height: 150px;
            width: 350px;
            background-color: #bfc;
        }

        .d2 {
            height: 200px;
            width: 200px;
            background-color: #fcc;
            border: #ccf 3px solid;
            overflow: scroll;
        }

        .d3 {
            height: 200px;
            width: 200px;
            background-color: #fcc;
            border: #ccf 3px solid;
            overflow: auto;
        }
    </style>
</head>

<body>
    <div class="d1">
        <div class="d1-1">
            overflow: hidden;
            <hr>
            子元素溢出父元素的部分会被隐藏
        </div>
    </div>
    <div class="d2">
        <div class="d1-1">
            overflow: scroll;
            <hr>
            无论子元素是否溢出，都会添加滚动条
        </div>
    </div>

    <div class="d3">
        <div class="d1-1">
            overflow: auto;
            <hr>
            根据子元素的溢出情况添加滚动条
        </div>
    </div>
</body>

</html>